package com.google.code.UtopiaXml;

/**
 * Base interface for representing parsed type
 *
 * @author Michael Simacek
 */
public interface Type {

    /**
     *
     * @return type name in upper camel case form.
     */
    String getTypeName();

    /**
     *
     * @return String containig fully qualified name for import or empty String
     * if no import is necessary
     */
    String getImport();

    /**
     * Returns default value of Type that can be used as a rvalue in
     * initialization
     *
     * @return default value
     */
    String getDefaultValue();

    /**
     * Append block of code that is supposed to parse given Node into
     * corresponding object
     *
     * @param cb CodeBuilder to append code to
     * @param nodeName name of the Node variable or a method call that returns a
     * Node
     * @param resName resulting object name. The result object will be declared
     * by this code
     */
    void appendLoaderFromElement(CodeBuilder cb, String nodeName, String resName);
}
